<?php
/**
 * Created by PhpStorm.
 * User: user1
 * Date: 2018/5/21
 * Time: 16:42
 */

namespace app\api\validate;


class CouponValidate extends BaseValidate
{
    protected $rule = [
        'name' => 'require',
        'unclaimed_image' => 'require',
        'already_received_image' => 'require',
        'used_image' => 'require',
        'expired_image' => 'require',
        'price' => 'require|isFloatOrPositiveInteger',
        'num' => 'egt:0',
        'start_time' => 'require|date',
        'end_time' => 'require|date',
    ];


    protected $message=[
        'name.require' => '活动名称不能为空',
        'unclaimed_image.require' => '请上传未领取图片',
        'already_received_image.require' => '请上传已领取图片',
        'used_image.require' => '请上传已使用图片',
        'expired_image.require' => '请上传已过期图片',
        'price.require' => '优惠金额不能为空',
        'price.isFloatOrPositiveInteger' => '优惠金额格式错误',
        'num.egt' => '优惠券数量必须大于等于0，0表示不限制',
        'start_time.require' => '请选择活动开始时间',
        'start_time.date' => '活动开始时间格式错误',
        'end_time.require' => '请选择活动结束时间',
        'end_time.date' => '活动结束时间格式错误',
    ];
}